package com.qzdsoft.erpcloud.controller.sys;

import java.util.List;

import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qzdsoft.erpcloud.service.sys.SysUserAgentService;
import com.qzdsoft.erpcloud.vo.sys.SysUserAgentQueryParam;
import com.qzdsoft.vo.DataTablePo;

/**
 * Created by Admin
 */
@Controller
@RequestMapping("/sys/user/agent")
public class SysUserAgentController {

    @Autowired
    private SysUserAgentService sysUserAgentService;

    @RequestMapping("/index")
    public Object index(HttpServletRequest request, Model model) {
        return "sys/user_agent";
    }

    @ResponseBody
    @RequestMapping("/data")
    public Object data(HttpServletRequest request, SysUserAgentQueryParam param) {
        Integer count = sysUserAgentService.selectDataCount(param.getName(), param.getPhone(), param.getAccountName());
        List list = sysUserAgentService.selectData(param.getName(), param.getPhone(), param.getAccountName(), param.getiDisplayStart(), param.getiDisplayLength());
        return new DataTablePo(count, list, param.getsEcho());
    }

}
